<?php
/* 
* @Author: LDF QQ 47121862
* @Date:   2014-06-11 08:48:11
* @Last Modified by:   LDF QQ 47121862
* @Last Modified time: 2014-06-12 17:41:26
*/
Class SearchControl extends ConfigControl{
	function index(){
		$keys=Q('keys');
		$total = M()->query("SELECT COUNT(*) AS t FROM ldf_article WHERE concat(aid,title,cont,uname,tags) LIKE '%{$keys}%'");
		$page = new Page($total[0]['t'],12);
		$SQL = " SELECT * FROM ldf_article WHERE concat(aid,title,cont,uname,tags) LIKE '%{$keys}%' ORDER BY `aid` DESC LIMIT {$page->limit(1)} ";
		// p($total[0]['t']);
		$data = M()->query($SQL);
		// p($data);
		$this->article=$data;
		$this->page=$page->show();
		$this->total=$total[0]['t'];
		$this->display();
	}
}